package com.meng.mengui;

import android.app.Activity;
import android.os.Bundle;
import android.widget.GridView;

import java.util.Arrays;

import butterknife.ButterKnife;
import butterknife.InjectView;

public class MainActivity extends Activity {

    @InjectView(R.id.gridview)
    GridView gridview;
    private MainAdapter adapter;
    String [] titile={"mengui","mengui","mengui","mengui"};
    Integer [] img={R.mipmap.icon_grid_dialog,R.mipmap.icon_grid_dialog,R.mipmap.icon_grid_dialog,R.mipmap.icon_grid_dialog};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.inject(this);
        initData();
    }

    private void initData() {

        adapter = new MainAdapter(this);
        adapter.setData(Arrays.asList(titile),Arrays.asList(img));
        gridview.setAdapter(adapter);
    }
}
